Index

Examples

Now we can perform a hypothesis test for a difference in proportions (using the formula interface y ~ x in specify())

Confidence interval for a difference in means (using the non-formula interface giving both the response and explanatory variables in specify())

Note that the formula and non-formula interfaces work for all implemented inference procedures in infer. Use whatever is more natural. If we will be doing modeling with functions like lm() and glm(), we should use the y ~ x notation.

Chi Sq

Now we have:

  • two numeric : arr_delay and dep_delay

  • two categories : season and day_hour

  • three categories for origin (EWR, JFK, LGA)

  • sixteen categories for carrier

One Numeric, One Categorical (2 Levels)

Calculate Observed Statistic

Our chi sq statistic is 1.05.

Calculate the Randomization-Based p-value

Overlay Appropriate Chisq distribution on Top of Permuted Statistics

Compute Theoretical P-value

## [1] 0.5920454

t test

One Numerical, One Categorical

Calculate Observed Statistic
The observed t-statistic is

.

Calculate the Randomization based p-value

Pipelines

Hypothesis Tests

One Numerical Variable (Mean)

Observed Stat

One Numerical Value (Standardized Mean t)

Observed Stat

One Numerical Variable (median)

Observed Stat

One Categorical (One Proportion)

Observed Stat

Logical variables will be coerced to factors:

Two Categorical (2 level) Variables

Observed Stat

Two Categorical (2 level) Variables (z)

One Categorical (> 2 level) - GoF

Observed Stat

Note the need to add in the hypothesized values here to compute the observed statistic.

Two Categorical (> 2 level) Variables

Observed Stat

One Numerical Variable, One Categorical (2 levels) :: Diff in Means

Observed Stat

One Numerical Variable, One Categorical (2 levels) (t)

One Numerical Value, One Categorical (2 levels) (diff in medians)

One Numerical, One Categorical (> 2 Levels) ANOVA

Two Numerical Variables - SLR

Two Numerical Values (correlation)

### Confidence Intervals

One Numerical (One Mean)

One Numerical (One Mean - Standardized)

One Categorical (One Proportion)

One Numerical, One Categorical (2 levels)(Diff in Means)

One Numerical Variable, One Categorical (2 levels) (t)

Two Categorical Variables (Diff in Proportions)

Two Categorical Variables (z)

Two Numeric Variables (SLR)

Two Numeric Variables Correlation

Randomization

Hypothesis Tests

Confidence Intervals

mtcars

Data Preparation

Confidence Intervals